home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / stabilzr.sit / The Stabilizer / card_7443.txt < prev    next >
Text File  |  1989-02-05  |  19KB  |  654 lines

  1. -- card: 7443 from stack: in
  2. -- bmap block id: 5119
  3. -- flags: 4000
  4. -- background id: 2175
  5. -- name: Year Totals
  6. ----- HyperTalk script -----
  7. on arrowKey direction
  8.   if direction is "right" then
  9.     go card "about"
  10.   else
  11.     pass arrowKey
  12.   end if
  13. end arrowkey
  14.  
  15.  
  16. -- part 4 (field)
  17. -- low flags: 01
  18. -- high flags: 4002
  19. -- rect: left=150 top=56 right=249 bottom=231
  20. -- title width / last selected line: 0
  21. -- icon id / first selected line: 0 / 0
  22. -- text alignment: 65535
  23. -- font id: 3
  24. -- text size: 12
  25. -- style flags: 0
  26. -- line height: 16
  27. -- part name: amounts
  28.  
  29.  
  30. -- part 5 (field)
  31. -- low flags: 01
  32. -- high flags: 4002
  33. -- rect: left=39 top=56 right=249 bottom=150
  34. -- title width / last selected line: 0
  35. -- icon id / first selected line: 0 / 0
  36. -- text alignment: 0
  37. -- font id: 3
  38. -- text size: 12
  39. -- style flags: 0
  40. -- line height: 16
  41. -- part name: months
  42. ----- HyperTalk script -----
  43. on mouseUp
  44.   put (item 2 of the clickLoc - 39) div 16 into whichLine
  45.   put the short name of the target into whichField
  46.   if line whichLine of card field whichField is empty then exit mouseUp
  47.   get line whichLine of card field whichField
  48.   visual barn door close slowly to gray
  49.   visual barn door open slowly
  50.   go card it
  51. end mouseUp
  52.  
  53.  
  54. -- part 6 (field)
  55. -- low flags: 01
  56. -- high flags: 0002
  57. -- rect: left=150 top=262 right=279 bottom=231
  58. -- title width / last selected line: 0
  59. -- icon id / first selected line: 0 / 0
  60. -- text alignment: 65535
  61. -- font id: 3
  62. -- text size: 12
  63. -- style flags: 0
  64. -- line height: 16
  65. -- part name: Total
  66.  
  67.  
  68. -- part 11 (field)
  69. -- low flags: 01
  70. -- high flags: 4002
  71. -- rect: left=235 top=56 right=249 bottom=316
  72. -- title width / last selected line: 0
  73. -- icon id / first selected line: 0 / 0
  74. -- text alignment: 65535
  75. -- font id: 3
  76. -- text size: 12
  77. -- style flags: 0
  78. -- line height: 16
  79. -- part name: balance
  80.  
  81.  
  82. -- part 12 (field)
  83. -- low flags: 01
  84. -- high flags: 0000
  85. -- rect: left=370 top=92 right=109 bottom=451
  86. -- title width / last selected line: 0
  87. -- icon id / first selected line: 0 / 0
  88. -- text alignment: 1
  89. -- font id: 0
  90. -- text size: 12
  91. -- style flags: 0
  92. -- line height: 16
  93. -- part name: StartMonth
  94.  
  95.  
  96. -- part 17 (field)
  97. -- low flags: 01
  98. -- high flags: 0000
  99. -- rect: left=370 top=135 right=152 bottom=451
  100. -- title width / last selected line: 0
  101. -- icon id / first selected line: 0 / 0
  102. -- text alignment: 1
  103. -- font id: 3
  104. -- text size: 12
  105. -- style flags: 0
  106. -- line height: 16
  107. -- part name: deposit/month
  108.  
  109.  
  110. -- part 18 (button)
  111. -- low flags: 00
  112. -- high flags: A002
  113. -- rect: left=367 top=290 right=307 bottom=454
  114. -- title width / last selected line: 0
  115. -- icon id / first selected line: 0 / 0
  116. -- text alignment: 1
  117. -- font id: 0
  118. -- text size: 12
  119. -- style flags: 0
  120. -- line height: 16
  121. -- part name: Set Month
  122. ----- HyperTalk script -----
  123. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  124.  
  125. on mouseUp
  126.   set cursor to 4
  127.   put line 1 of card field "startMonth" into noChange
  128.   get card field "Total"
  129.   delete char 1 of it
  130.   divide it by 12
  131.   put it into deposit
  132.   put card field "amounts" into tempAm
  133.   repeat with z = 1 to 12
  134.     delete char 1 of line z of tempAm
  135.   end repeat
  136.  
  137.   repeat
  138.     answer "Should Mac choose the best month to start?" with "Help" or "No" or "Yes"
  139.     if it = "Help" then
  140.       push card
  141.       visual venetian blinds to gray
  142.       visual venetian blinds
  143.       go card "Choosing"
  144.       repeat until the mouse is down
  145.       end repeat
  146.       visual venetian blinds to gray
  147.       visual venetian blinds
  148.       pop card
  149.     else
  150.       exit repeat
  151.     end if
  152.   end repeat
  153.  
  154.   if it = "No" then
  155.     set loc of msg to 18,15
  156.     put "Please click on the month you want to start your deposits."
  157.     set cursor to 3
  158.     repeat until the mouse is down
  159.     end repeat
  160.     set cursor to 4
  161.     put item 1 of the mouseLoc into temp1
  162.     put item 2 of the mouseLoc into temp2
  163.     if temp1 < 39 or temp1 > 150 then
  164.       hide msg
  165.       exit mouseUp
  166.     end if
  167.     if temp2 < 56 or temp2 > 249 then
  168.       hide msg
  169.       exit mouseUp
  170.     end if
  171.     if temp1 >= 39 and temp1 <= 150 then
  172.       put (temp2 - 39) div 16 into whichLine
  173.       if line whichLine of card field "months" is empty then
  174.         hide msg
  175.         exit mouseUp
  176.       end if
  177.     end if
  178.     if line whichLine of card field "months" = noChange then
  179.       hide msg
  180.       exit mouseUp
  181.     end if
  182.     set loc of msg to 19,106
  183.     put "This might take a minute, please wait."
  184.     put line whichLine of card field "months" into line 1 of card field "startMonth"
  185.     put whichLine into i
  186.     set numberFormat to "0.00"
  187.     put "0" into tempDep
  188.     repeat 12
  189.       add deposit to tempDep
  190.       put tempDep - line i of tempAm into line i of tempBal
  191.       put line i of tempBal into tempDep
  192.       if i = 12 then put 1 into i
  193.       else add 1 to i
  194.     end repeat
  195.     repeat with i = 1 to 12
  196.       put "$" before char 1 of line i of tempBal
  197.     end repeat
  198.     put tempBal into card field "balance" of card "Year Totals"
  199.   else
  200.     set cursor to 4
  201.     set loc of msg to 19,106
  202.     put "This might take a minute, please wait."
  203.     repeat with x =1 to 12
  204.       put x into i
  205.       put "0" into tempDep
  206.       repeat 12
  207.         add deposit to tempDep
  208.         put tempDep - line i of tempAm into item i of tempBal
  209.         put item i of tempBal into tempDep
  210.         if i = 12 then put 1 into i
  211.         else add 1 to i
  212.       end repeat
  213.       put min(tempBal) into item x of lowBal
  214.     end repeat
  215.     get max(lowBal)
  216.     repeat with i = 1 to 12
  217.       if it = item i of lowBal then exit repeat
  218.     end repeat
  219.     put "0" into tempDep
  220.     put line i of card field "months" into line 1 of card field "startMonth"
  221.     set numberFormat to "0.00"
  222.     repeat 12
  223.       add deposit to tempDep
  224.       put tempDep - line i of tempAm into line i of tempBal
  225.       put line i of tempBal into tempDep
  226.       if i = 12 then put 1 into i
  227.       else add 1 to i
  228.     end repeat
  229.     repeat with i = 1 to 12
  230.       put "$" before char 1 of line i of tempBal
  231.     end repeat
  232.     put tempBal into card field "balance"
  233.   end if
  234.   put line 1 of card field "startMonth" && "1," & last item of the long date into startDate
  235.   convert startDate to dateItems
  236.   get the date
  237.   convert it to dateItems
  238.   set numberFormat to "0"
  239.   if item 2 of it >= item 2 of startDate then add 1 to item 1 of startDate
  240.   convert startDate to date
  241.   convert startDate to seconds
  242.   put startDate into line 2 of card field "startMonth"
  243.   put line 3 of card field "startMonth" into whichBills
  244.   if whichBills Γëá empty then
  245.     put card field "months" into tempMonths
  246.     put line 1 of card field "startMonth" into starMon
  247.     if starMon = noChange then
  248.       hide msg
  249.       exit mouseUp
  250.     end if
  251.     repeat with i = 1 to the number of lines in tempMonths
  252.       if starMon = line i of tempMonths then exit repeat
  253.     end repeat
  254.     repeat with z = 1 to 12
  255.       put line i of tempMonths into line z of adjMonths
  256.       if i = 12 then
  257.         put "1" into i
  258.       else
  259.         add 1 to i
  260.       end if
  261.     end repeat
  262.     put item 1 of whichBills into bill
  263.     put field "months" of card bill into tempMonths
  264.     repeat with i = 1 to the number of lines in tempMonths
  265.       if starMon = line i of tempMonths then exit repeat
  266.     end repeat
  267.     repeat with x = 1 to the number of items in whichBills
  268.       put item x of whichBills into bill
  269.       repeat with z = 1 to 12
  270.         put line i of field "base" of card bill into line z of bas
  271.         put line i of field "amount" of card bill into line z of amo
  272.         put line i of field "projected" of card bill into line z of pro
  273.         put line i of field "actual" of card bill into line z of act
  274.         if i = 12 then
  275.           put "1" into i
  276.         else
  277.           add 1 to i
  278.         end if
  279.       end repeat
  280.       put word 1 of item 2 of the long date into thisMonth
  281.       repeat with i = 1 to the number of lines in adjMonths
  282.         if thisMonth = line i of adjMonths then exit repeat
  283.       end repeat
  284.       repeat with y = 1 to i
  285.         if line y of act = empty and line y of amo Γëá empty then
  286.           put line y of amo into line y of act
  287.           put line y of bas into line y of amo
  288.         end if
  289.       end repeat
  290.       put field "increase" of card bill into inc
  291.       delete last char of inc
  292.       repeat with y = (i + 1) to the number of lines in act
  293.         if line y of act Γëá empty then
  294.           put line y of amo into line y of bas
  295.           put line y of act into line y of amo
  296.           put empty into line y of act
  297.         end if
  298.       end repeat
  299.       get the long date
  300.       put starMon into word 1 of item 2 of it
  301.       convert it to dateItems
  302.       put item 2 of it into whichMonth
  303.       get the long date
  304.       convert it to dateItems
  305.       if item 2 of it = whichMonth then
  306.         put item 1 of it into field "thisYear1" of card bill
  307.         put item 1 of it into field "thisYear2" of card bill
  308.         put item 1 of it - 1 into field "lastYear" of card bill
  309.       else
  310.         if item 2 of it < whichMonth then
  311.           put item 1 of it - 1 && "-" && item 1 of it into field "thisYear1" of card bill
  312.           put item 1 of it - 1 && "-" && item 1 of it into field "thisYear2" of card bill
  313.           put item 1 of it - 2 && "-" && item 1 of it - 1 into field "lastYear" of card bill
  314.         else
  315.           put item 1 of it && "-" && item 1 of it + 1 into field "thisYear1" of card bill
  316.           put item 1 of it && "-" && item 1 of it + 1 into field "thisYear2" of card bill
  317.           put item 1 of it - 1 && "-" && item 1 of it into field "lastYear" of card bill
  318.         end if
  319.       end if
  320.       put bas into field "base" of card bill
  321.       put amo into field "amount" of card bill
  322.       put pro into field "projected" of card bill
  323.       put act into field "actual" of card bill
  324.       put adjMonths into field "months" of card bill
  325.     end repeat
  326.   end if
  327.   hide msg
  328. end mouseUp
  329.  
  330.  
  331. -- part 19 (field)
  332. -- low flags: 01
  333. -- high flags: 0000
  334. -- rect: left=370 top=183 right=200 bottom=451
  335. -- title width / last selected line: 0
  336. -- icon id / first selected line: 0 / 0
  337. -- text alignment: 1
  338. -- font id: 3
  339. -- text size: 12
  340. -- style flags: 0
  341. -- line height: 16
  342. -- part name: perPay
  343.  
  344.  
  345. -- part 20 (field)
  346. -- low flags: 01
  347. -- high flags: 0000
  348. -- rect: left=370 top=215 right=232 bottom=451
  349. -- title width / last selected line: 0
  350. -- icon id / first selected line: 0 / 0
  351. -- text alignment: 1
  352. -- font id: 0
  353. -- text size: 12
  354. -- style flags: 0
  355. -- line height: 16
  356. -- part name: Pays
  357.  
  358.  
  359. -- part 21 (button)
  360. -- low flags: 00
  361. -- high flags: A002
  362. -- rect: left=367 top=262 right=279 bottom=454
  363. -- title width / last selected line: 0
  364. -- icon id / first selected line: 0 / 0
  365. -- text alignment: 1
  366. -- font id: 0
  367. -- text size: 12
  368. -- style flags: 0
  369. -- line height: 16
  370. -- part name: Set Pays
  371. ----- HyperTalk script -----
  372. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  373.  
  374. on mouseUp
  375.   put card field "Total" into tempTotal
  376.   delete char 1 of tempTotal
  377.   ask "Please enter the number of pays per year" with word 1 of card field "pays"
  378.   if it is not empty then
  379.     put it into word 1 of card field "pays"
  380.     divide tempTotal by it
  381.     set numberFormat to "0.00"
  382.     put "$" & tempTotal into card field "perPay"
  383.   end if
  384. end mouseUp
  385.  
  386.  
  387.  
  388. -- part 22 (button)
  389. -- low flags: 00
  390. -- high flags: 2000
  391. -- rect: left=7 top=302 right=342 bottom=46
  392. -- title width / last selected line: 0
  393. -- icon id / first selected line: 11030 / 11030
  394. -- text alignment: 1
  395. -- font id: 0
  396. -- text size: 12
  397. -- style flags: 0
  398. -- line height: 16
  399. -- part name: Home
  400. ----- HyperTalk script -----
  401. on mouseUp
  402.   visual barn door close slowly to gray
  403.   visual dissolve
  404.   go stack "Home"
  405. end mouseUp
  406.  
  407.  
  408.  
  409. -- part 24 (button)
  410. -- low flags: 00
  411. -- high flags: A002
  412. -- rect: left=63 top=290 right=307 bottom=207
  413. -- title width / last selected line: 0
  414. -- icon id / first selected line: 0 / 0
  415. -- text alignment: 1
  416. -- font id: 0
  417. -- text size: 12
  418. -- style flags: 0
  419. -- line height: 16
  420. -- part name: Recalculate Account
  421. ----- HyperTalk script -----
  422. on mouseUp
  423.   doMath
  424. end mouseUp
  425.  
  426.  
  427.  
  428. -- part 25 (field)
  429. -- low flags: 01
  430. -- high flags: 0002
  431. -- rect: left=80 top=11 right=28 bottom=272
  432. -- title width / last selected line: 0
  433. -- icon id / first selected line: 0 / 0
  434. -- text alignment: 1
  435. -- font id: 0
  436. -- text size: 12
  437. -- style flags: 0
  438. -- line height: 16
  439. -- part name: title
  440.  
  441.  
  442. -- part 26 (button)
  443. -- low flags: 00
  444. -- high flags: 2000
  445. -- rect: left=259 top=305 right=341 bottom=297
  446. -- title width / last selected line: 0
  447. -- icon id / first selected line: 26104 / 26104
  448. -- text alignment: 1
  449. -- font id: 0
  450. -- text size: 12
  451. -- style flags: 0
  452. -- line height: 16
  453. -- part name: HelpIndex
  454. ----- HyperTalk script -----
  455. on mouseUp
  456.   push card
  457.   helpIndex
  458. end mouseUp
  459.  
  460.  
  461.  
  462. -- part 27 (button)
  463. -- low flags: 00
  464. -- high flags: 0000
  465. -- rect: left=469 top=307 right=339 bottom=506
  466. -- title width / last selected line: 0
  467. -- icon id / first selected line: 16816 / 16816
  468. -- text alignment: 1
  469. -- font id: 0
  470. -- text size: 12
  471. -- style flags: 0
  472. -- line height: 16
  473. -- part name: PopCard
  474. ----- HyperTalk script -----
  475. on mouseUp
  476.   visual barn door close slowly to gray
  477.   visual barn door open slowly
  478.   pop card
  479. end mouseUp
  480.  
  481.  
  482.  
  483. -- part 28 (button)
  484. -- low flags: 00
  485. -- high flags: A002
  486. -- rect: left=86 top=318 right=335 bottom=180
  487. -- title width / last selected line: 0
  488. -- icon id / first selected line: 0 / 0
  489. -- text alignment: 1
  490. -- font id: 0
  491. -- text size: 12
  492. -- style flags: 0
  493. -- line height: 16
  494. -- part name: Print Report
  495. ----- HyperTalk script -----
  496. --Copyright ┬⌐1988 - Scott McGilliard - all rights reserved
  497.  
  498. on mouseUp
  499.   push card
  500.   set lockScreen to true
  501.   set cursor to 4
  502.   open printing
  503.   go card "printTotals"
  504.   put the date into card field "date" of card "printTotals"
  505.   put card field "title" of card "Year Totals" into card field "title" of card "printTotals"
  506.   put card field "amounts" of card "Year Totals" into card field "amounts" of card "printTotals"
  507.   put card field "total" of card "Year Totals" into card field "total" of card "printTotals"
  508.   put card field "balance" of card "Year Totals" into card field "balance" of card "printTotals"
  509.   put line 1 of card field "startMonth" of card "Year Totals" into card field "startMonth" of card "printTotals"
  510.   put card field "deposit/month" of card "Year Totals" into card field "deposit/month" of card "printTotals"
  511.   put card field "perPay" of card "Year Totals" into card field "perPay" of card "printTotals"
  512.   put card field "pays" of card "Year Totals" into card field "pays" of card "printTotals"
  513.   get field "expense" of card "Expenses"
  514.   put field "expense2" of card "Expenses" after it
  515.   put field "expense3" of card "Expenses" after it
  516.   put the number of lines of it into lineNum
  517.   put trunc(lineNum / 2) into linNum
  518.   if linNum * 2 = lineNum then
  519.     add 1 to linNum
  520.   else
  521.     add 2 to linNum
  522.   end if
  523.   put line linNum to lineNum of it into card field "expense2" of card "printList"
  524.   delete line linNum to lineNum of it
  525.   put it into card field "expense1" of card "printList"
  526.   set rect of card field "expense1" of card "printList" to 67,47,234,linNum * 11 + 47
  527.   set rect of card field "expense2" of card "printList" to 277,47,440,linNum * 11 + 47
  528.   print 2 cards
  529.   go card "printMonths"
  530.   put 2 into i
  531.   repeat 3
  532.     get field "monthName" of card i
  533.     put it && "- Total -" && field "subTotal" of card i into card field "month1" of card "printMonths"
  534.     put field "expense" of card i & return & field "expense2" of card i into card field "expense1" of card "printMonths"
  535.     get the number of lines of card field "expense1" of card "printMonths"
  536.     add 1 to it
  537.     set the rect of card field "expense1" of card "printMonths" to 0,12,160,(it * 11 + 12)
  538.     put field "amount" of card i & return & field "amount2" of card i into card field "amount1" of card "printMonths"
  539.     get the number of lines of card field "amount1" of card "printMonths"
  540.     add 1 to it
  541.     set the rect of card field "amount1" of card "printMonths" to 159,12,235,(it * 11 + 12)
  542.     add 1 to i
  543.     get field "monthName" of card i
  544.     put it && "- Total -" && field "subTotal" of card i into card field "month2" of card "printMonths"
  545.     put field "expense" of card i & return & field "expense2" of card i into card field "expense2" of card "printMonths"
  546.     get the number of lines of card field "expense2" of card "printMonths"
  547.     add 1 to it
  548.     set the rect of card field "expense2" of card "printMonths" to 277,12,437,(it * 11 + 12)
  549.     put field "amount" of card i & return & field "amount2" of card i into card field "amount2" of card "printMonths"
  550.     get the number of lines of card field "amount2" of card "printMonths"
  551.     add 1 to it
  552.     set the rect of card field "amount2" of card "printMonths" to 436,12,512,(it * 11 + 12)
  553.     add 1 to i
  554.     get field "monthName" of card i
  555.     put it && "- Total -" && field "subTotal" of card i into card field "month1" of card "printMonths2"
  556.     put field "expense" of card i & return & field "expense2" of card i into card field "expense1" of card "printMonths2"
  557.     get the number of lines of card field "expense1" of card "printMonths2"
  558.     add 1 to it
  559.     set the rect of card field "expense1" of card "printMonths2" to 0,12,160,(it * 11 + 12)
  560.     put field "amount" of card i & return & field "amount2" of card i into card field "amount1" of card "printMonths2"
  561.     get the number of lines of card field "amount1" of card "printMonths2"
  562.     add 1 to it
  563.     set the rect of card field "amount1" of card "printMonths2" to 159,12,235,(it * 11 + 12)
  564.     add 1 to i
  565.     get field "monthName" of card i
  566.     put it && "- Total -" && field "subTotal" of card i into card field "month2" of card "printMonths2"
  567.     put field "expense" of card i & return & field "expense2" of card i into card field "expense2" of card "printMonths2"
  568.     get the number of lines of card field "expense2" of card "printMonths2"
  569.     add 1 to it
  570.     set the rect of card field "expense2" of card "printMonths2" to 277,12,437,(it * 11 + 12)
  571.     put field "amount" of card i & return & field "amount2" of card i into card field "amount2" of card "printMonths2"
  572.     get the number of lines of card field "amount2" of card "printMonths2"
  573.     add 1 to it
  574.     set the rect of card field "amount2" of card "printMonths2" to 436,12,512,(it * 11 + 12)
  575.     add 1 to i
  576.     print 2 cards
  577.   end repeat
  578.   close printing
  579.   pop card
  580. end mouseUp
  581.  
  582.  
  583.  
  584. -- part contents for card part 5
  585. ----- text -----
  586. January
  587. February
  588. March
  589. April
  590. May
  591. June
  592. July
  593. August
  594. September
  595. October
  596. November
  597. December
  598.  
  599. -- part contents for card part 4
  600. ----- text -----
  601. $0
  602. $0
  603. $0
  604. $0
  605. $0
  606. $0
  607. $0
  608. $0
  609. $0
  610. $0
  611. $0
  612. $0
  613.  
  614.  
  615. -- part contents for card part 6
  616. ----- text -----
  617. $0.00
  618.  
  619. -- part contents for card part 11
  620. ----- text -----
  621. $0.00
  622. $0.00
  623. $0.00
  624. $0.00
  625. $0.00
  626. $0.00
  627. $0.00
  628. $0.00
  629. $0.00
  630. $0.00
  631. $0.00
  632. $0.00
  633.  
  634. -- part contents for card part 17
  635. ----- text -----
  636. $0.00
  637.  
  638. -- part contents for card part 20
  639. ----- text -----
  640. 24 Pays
  641.  
  642. -- part contents for card part 25
  643. ----- text -----
  644. SUMMARY FOR 1988 - 1989
  645.  
  646. -- part contents for card part 19
  647. ----- text -----
  648. $0.00
  649.  
  650. -- part contents for card part 12
  651. ----- text -----
  652. January
  653. 2682460800
  654. template